<!--<?php
require_once(uTemplate::printEot('header'));
//require_once(uTemplate::printEot('user_appleft'));
InitGP('s');
print <<<EOT
-->
<style type="text/css">
.textareaA{width:312px;height:62px;overflow:auto;background:#fff;line-height:1.4;}
</style>
<div class="contUser">
	<div class="p15">
		<div class="navC">
			<ul>
<!--
EOT;
$b = $a;
($a == 'friendslists' ||  $a == 'friendlist' || $a == 'frienddetail') && $b = 'friend';
print <<<EOT
-->
				<li id="a_friend"><a href="{$basename}a=friendslists">好友日志</a></li>
				<li id="a_my"><a href="{$basename}">我的日志</a></li>
<script language="JavaScript">
setCurrent('a_$b','a_my','current');
</script>
			</ul>
			<span class="btn_add fl"><span><button onclick="window.location.href='{$basename}a=write';">写新日志</button></span></span>
		</div>
<!--
EOT;
if ($a == "list") {print <<<EOT
-->
		<div class="sidebar fr">
<!--
EOT;
require_once PrintEot('m_diary_type');
print <<<EOT
-->        
		</div>
	<div class="contentB">
	<div class="p10 cc">
<!--
EOT;
$privacy = array('全站可见','仅好友可见','仅自己可见');
if ($diaryDb) {print <<<EOT
-->
		<div class="dlB">
<!--
EOT;
foreach($diaryDb as $value){
$typename = !$value[dtid] ?  '默认分类' : $diaryType[$value[dtid]][name];
!$value[dtid] && $value[dtid] = '-1';
$title = '所属:'.$value[username].'&nbsp;'.$value[title];
$descrip = $value[subject];
print <<<EOT
-->
		<dl class="dl">
			<dt class="dt mb10"><a class="adel" href="javascript:;" onclick="pwConfirm('是否确认删除？',this,function(){delDiary('$value[did]','$value[uid]')})">删除</a><a class="aedit mr10" href="{$basename}a=edit&did=$value[did]">编辑</a>
			<p class="mb5"><a href="{$basename}a=detail&did=$value[did]" class="f16 b">{$value[subject]}</a></p><span class="gray">{$value[postdate]}</span></dt>
			<dd class="dd">
				<p class="mb10">{$value[content]}</p>
				<cite class="gray">
				<a href="{$basename}a=detail&did=$value[did]" class="fr s7">阅读全文&raquo;</a>
				分类：<a class="s7" href="{$basename}dtid=$value[dtid]">{$typename}</a><span class="p_lr_10">|</span>回复：{$value[c_num]}<span class="p_lr_10">|</span>浏览：{$value[r_num]}<span class="p_lr_10">|</span>
{$privacy[$value[privacy]]}
				</cite>
			</dd>
		</dl>
<!--
EOT;
}print <<<EOT
-->
		</div>
		<div class="mb10 cc">$pages</div>
<!--
EOT;
} else {print <<<EOT
-->
<!--
EOT;
		if (!$dtid) {print <<<EOT
-->
			<div class="p10 f14 tac">暂无日志</div>
<!--
EOT;
		} else {print <<<EOT
-->
			<div class="p10 f14 tac">此分类下暂无日志</div>
<!--
EOT;
		}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
	</div>
	</div>
<!--
EOT;
} elseif ($a == "detail") {
$copy = $diary[copyurl] ? '转载于' : '发表于';

print <<<EOT
-->
	<div class="cc contentB">
	<div id="diary_$did"></div>
	<div class="p10 bdB">
		<div class="fr">
		<a href="apps.php?q=collection&a=favor&type=diary&ajax=1&id={$diary['did']}" onclick="return ajaxurl(this)" class="mr20 allCollect">收藏</a>
<!--
EOT;
if ($weiboPriv) {print <<<EOT
-->
<a href="javascript:;" onclick="sendmsg('operate.php?action=toweibo&ajax=1&type=diary&id=$did','',this.id);" class="allForward">新鲜事</a>
<!--
EOT;
}print <<<EOT
-->
		</div>
		<a href="apps.php?q=diary" class="lh_18">返回列表</a>
	</div>
	<div class="p10">
					<h1 class="mb10">{$diary[subject]}</h1>
<!--
EOT;
if($winduid || $SYSTEM['deldiary']){print <<<EOT
-->                         
						<a class="adel" href="javascript:;" onclick="pwConfirm('是否确认删除？',this,function(){delDiary('$diary[did]','$winduid','read')})">删除</a>
<!--
EOT;
}if ($winduid) {print <<<EOT
-->
						<a class="mr10 aedit" href="{$basename}a=edit&did=$diary[did]">编辑</a> 
<!--
EOT;
}print <<<EOT
-->
					<p class="gray mb5">{$diary[postdate]}</p>
<!--
EOT;
if($diary[copyurl]){print <<<EOT
-->
					<div class="mb20 s5">转载自：<a href="u.php?uid=$diary[copyuid]" target="_blank" class="s2 mr5">$diary[copyer]</a><a href="$diary[url]" target="_blank">$diary[url]</a></div>
<!--
EOT;
}print <<<EOT
-->
					<div class="contentText s5 f14 mb20">
					<table style="table-layout: fixed;" class="vt"><tr><td height="200">
						{$diary[content]}
<!--
EOT;
if($diary['pic']){
foreach($diary['pic'] as $pic){
if($pic){print <<<EOT
-->
						<div class="f12" id="att_$pic[aid]" style="width:450px;overflow:hidden;margin:5px 0px 5px 0;">
<!--
EOT;
if($pic['desc']){print <<<EOT
-->
							描述:$pic[desc]<br />
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($pic[img]) {print <<<EOT
-->
							图片:$pic[img]
<!--
EOT;
if($pic['dfadmin']){print <<<EOT
-->
							[<a style="cursor:pointer" onclick="deldiaryatt('$diary[did]','$pic[aid]');">删除</a>]
<!--
EOT;
}}print <<<EOT
-->
						</div>
<!--
EOT;
}}}print <<<EOT
-->
					</td></tr></table>
					</div>
					<div class="mb10 gray">
<!--
EOT;
$typename = !$diary[dtid] ?  '默认分类' : $diaryType[$diary[dtid]][name];
!$diary[dtid] && $diary[dtid] = '-1';
$privacy = array('全站可见','仅好友可见','仅自己可见');
print <<<EOT
--->
						分类：<a href="{$basename}dtid=$diary[dtid]" class="s7">{$typename}</a><span class="p_lr_10">|</span>回复：{$diary[c_num]}<span class="p_lr_10">|</span>浏览：{$diary[r_num]}<span class="p_lr_10">|</span>{$privacy[$diary[privacy]]}<!--
EOT;
if ($_G['allowreport']) {print <<<EOT
--><span class="p_lr_10">|</span><a class="mr10 s7" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=report&type=diary&tid=$did&pid=$winduid','',this.id);" id="report_diary">举报</a> 
<!--
EOT;
}print <<<EOT
-->				

                    </div>
					<div class="cc mb10 seeMore">
						<a class="fl" title="下一篇" href="{$basename}a=next&did=$diary[did]" onclick="return ajaxpage(this.href,'next','$winduid','$space');">下一篇</a>
						<a  class="fr" title="上一篇"href="{$basename}a=pre&did=$diary[did]" onclick="return ajaxpage(this.href,'pre','$winduid','$space');">上一篇</a>
					</div>
<!--
EOT;
require_once PrintEot('m_comment');print <<<EOT
-->
<script type="text/javascript" language="JavaScript" src="js/pw_lwd.js"></script>
					

				</div>
	</div>
<!--
EOT;
} elseif ($a == 'friendslists') {print <<<EOT
-->
	<div class="contentB">
	<!--div class="tips">共 <em>{$count}</em> 篇日志</div-->
	<div class="p10 cc">
<!--
EOT;
$privacy = array('全站可见','仅好友可见','仅自己可见');
if($count){print <<<EOT
-->
		<div class="dlB">
<!--
EOT;
foreach($diaryDb as $value){
$typename = !$value[dtid] ?  '默认分类' : $value[typename];
$title = '所属:'.$value[username].'&nbsp;'.$value[title];
$descrip = $value[subject];
$author = "<a href=\"u.php?uid=$value[uid]\" class=\"f16 b\">$value[username]:</a> ";

print <<<EOT
-->
						<dl class="dl">
							<dt class="dt mb10">
<!--
EOT;
if ($SYSTEM['deldiary']) {print <<<EOT
-->
								<a class="adel" href="javascript:;" onclick="pwConfirm('是否确认删除？',this,function(){delDiary('$value[did]','$value[uid]')})">删除</a>
<!--
EOT;
}print <<<EOT
-->
								<p class="mb5">{$author}<a href="{$basename}a=frienddetail&fuid={$value[uid]}&did=$value[did]" class="f16 b s5">{$value[subject]}</a></p><span class="gray">{$value[postdate]}</span>
							</dt>
							<dd class="dd">
								<p class="mb20">{$value[content]}</p>
								<cite class="gray">
									<a href="{$basename}a=frienddetail&fuid=$value[uid]&did=$value[did]" class="fr s7">阅读全文&raquo;</a>
<!--
EOT;
!$value[dtid] && $value[dtid] = '-1';
print <<<EOT
-->
									分类：<a class="s7" href="{$basename}a=friendlist&fuid=$value[uid]&dtid=$value[dtid]">{$typename}</a><span class="p_lr_10">|</span>回复：{$value[c_num]}<span class="p_lr_10">|</span>浏览：{$value[r_num]}<span class="p_lr_10">|</span>

									{$privacy[$value[privacy]]}
								</cite>
							</dd>
						</dl>
<!--
EOT;
}print <<<EOT
-->	
					</div>
				<div class="p10 cc">$pages</div>
<!--
EOT;
}else{print <<<EOT
-->

<!--
EOT;
		if (!$dtid) {print <<<EOT
-->
			<div class="p10 f14 tac">好友暂无日志</div>
<!--
EOT;
		} else {print <<<EOT
-->
			<div class="p10 f14 tac">此分类下暂无日志</div>
<!--
EOT;
		}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
	</div>
	</div>
<!--
EOT;
} elseif ($a == 'friendlist') {print <<<EOT
-->
<div class="sidebar fr">
	<div class="c mb10">&nbsp;</div>
<!--
EOT;
require_once PrintEot('m_diary_type');
print <<<EOT
-->        
</div>
	<!--div class="tips">共 <em>{$count}</em> 篇日志</div-->
	<div class="contentB">
	<div class="p10 cc">
<!--
EOT;
$privacy = array('全站可见','仅好友可见','仅自己可见');
if($count){print <<<EOT
-->
			<div class="dlB">
<!--
EOT;
foreach($diaryDb as $value){
$typename = !$value[dtid] ?  '默认分类' : $diaryType[$value[dtid]][name];
$title = '所属:'.$value[username].'&nbsp;'.$value[title];
$descrip = $value[subject];
$author = "<a href=\"u.php?uid=$value[uid]\" class=\"f16 b\">$value[username]:</a> ";

print <<<EOT
-->
				<dl class="dl">
					<dt class="dt mb10">
<!--
EOT;
if ($SYSTEM['deldiary']) {print <<<EOT
-->
						<a class="adel" href="javascript:;" onclick="pwConfirm('是否确认删除？',this,function(){delDiary('$value[did]','$value[uid]')})">删除</a>
<!--
EOT;
}print <<<EOT
-->
						<p class="mb5">{$author}<a href="{$basename}a=frienddetail&fuid={$value[uid]}&did=$value[did]" class="f16 b s5">{$value[subject]}</a></p>
						<span class="gray">{$value[postdate]}</span>
					</dt>
					<dd class="dd">
						<p class="mb20">{$value[content]}</p>
<!--
EOT;
!$value[dtid] && $value[dtid] = '-1';
print <<<EOT
-->
						<cite class="gray"><a href="{$basename}a=frienddetail&fuid={$value[uid]}&did=$value[did]" class="fr s7">阅读全文&raquo;</a>分类：<a class="s7" href="{$basename}a=friendlist&fuid=$value[uid]&dtid=$value[dtid]">{$typename}</a><span class="p_lr_10">|</span>回复：{$value[c_num]}<span class="p_lr_10">|</span>浏览：{$value[r_num]}<span class="p_lr_10">|</span>

						{$privacy[$value[privacy]]}
						</cite>
					</dd>
				</dl>
<!--
EOT;
}print <<<EOT
-->	
					</div>
				<div class="p10 cc">$pages</div>
<!--
EOT;
}else{print <<<EOT
-->			

<!--
EOT;
		if (!$dtid) {print <<<EOT
-->
			<div class="p10 f14 tac">好友暂无日志</div>
<!--
EOT;
		} else {print <<<EOT
-->
			<div class="p10 f14 tac">此分类下暂无日志</div>
<!--
EOT;
		}print <<<EOT
-->

<!--
EOT;
}print <<<EOT
-->
	</div>
	</div>
<!--
EOT;
} elseif ($a == 'frienddetail') {print <<<EOT
-->
	<div class="sidebar fr">
<!--
EOT;
require_once PrintEot('m_diary_type');
print <<<EOT
-->        
	</div>
	<div class="contentB">
		<div class="p10 cc">
			<div class="fr">
<a href="apps.php?q=collection&a=favor&type=diary&ajax=1&id={$diary['did']}" onclick="return ajaxurl(this)" class="mr20 allCollect">收藏</a>
<!--
EOT;
if ($weiboPriv) {print <<<EOT
-->
<a href="javascript:;" onclick="sendmsg('operate.php?action=toweibo&ajax=1&type=diary&id=$did','',this.id);" class="allForward">新鲜事</a>
<!--
EOT;
}print <<<EOT
-->
		</div>
		<h1 class="mb5"><a href="u.php?uid=$value[uid]" class="f16 b">$diary[username]</a>: {$diary[subject]}</h1>
<!--
EOT;
if($SYSTEM['deldiary']){print <<<EOT
-->
							<a class="adel" href="javascript:;" onclick="pwConfirm('是否确认删除？',this,function(){delDiary('$diary[did]','$winduid','read')})">删除</a>
<!--
EOT;
}print <<<EOT
-->
					<p class="mb10 gray">{$diary[postdate]}</p>
					<div class="contentText s5 f14 mb20" id="img-width">
					<table style="table-layout: fixed;"><tr class="vt"><td height="200">
					<div class="mb10">{$diary[content]}</div>
<!--
EOT;
if($diary['pic']){
foreach($diary['pic'] as $pic){
if($pic){print <<<EOT
-->
						<div class="f12 mb10" id="att_$pic[aid]" style="width:450px;overflow:hidden;">
<!--
EOT;
if($pic['desc']){print <<<EOT
-->
							描述:$pic[desc]<br />
<!--
EOT;
}print <<<EOT
-->
							图片:$pic[img]
<!--
EOT;
if($pic['dfadmin']){print <<<EOT
-->
							[<a style="cursor:pointer" onclick="deldiaryatt('$diary[did]','$pic[aid]');">删除</a>]
<!--
EOT;
}print <<<EOT
-->
						</div>
<!--
EOT;
}}}print <<<EOT
-->


					</td></tr></table>
					</div>    
					<div class="mb10">
							<span class="gray">
<!--
EOT;
$typename = !$diary[dtid] ?  '默认分类' : $diaryType[$diary[dtid]][name];
!$diary[dtid] && $diary[dtid] = '-1';
$privacy = array('全站可见','仅好友可见','仅自己可见');
print <<<EOT
--->
							分类：<a href="{$basename}a=friendlist&fuid=$diary[uid]&dtid=$diary[dtid]" class="s7">{$typename}</a><span class="p_lr_10">|</span>回复：{$diary[c_num]}<span class="p_lr_10">|</span>浏览：{$diary[r_num]}<span class="p_lr_10">|</span>{$privacy[$diary[privacy]]}<!--
EOT;
if ($_G['allowreport']) {print <<<EOT
--><span class="p_lr_10">|</span><a class="s7" href="javascript:;" onclick="sendmsg('pw_ajax.php?action=report&type=diary&tid=$did&pid=$fuid','',this.id);" id="report_diary">举报</a><!--
EOT;
}if($diary[ifcopy]){print <<<EOT
--><span class="p_lr_10">|</span><a href="{$basename}a=copydiary&did=$diary[did]" onclick="return ajaxurl(this);" class="s7">转载</a>
<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
</script>
<!--
EOT;
}print <<<EOT
-->
							</span>
					</div>
					<div class="mb10 cc">
<!-- 
EOT;
$rateSets = unserialize($db_ratepower);
if($rateSets[2] && isset($db_hackdb['rate'])){
print <<<EOT
-->	 
						<link rel="stylesheet" type="text/css" href="hack/rate/images/rate.css" />
						<script language="JavaScript" src="js/rate_ajax.js"></script>
						<script language="javascript">
						window.onload = function() {
							rate.getVote("vote_box","{$db_bbsurl}/hack.php?H_name=rate&action=ajax","elementid=vote_box&typeid=2&objectid={$did}&authorid={$uid}");
						};
						</script>						
						<div id="vote_box"></div>
<!-- 
EOT;
}
print <<<EOT
-->
					</div>
					<div class="c">&nbsp;</div>
					<div class="cc mb10 seeMore">
						<a class="fl" title="下一篇" href="{$basename}a=next&fuid={$fuid}&did=$diary[did]" onclick="return ajaxpage(this.href,'next','$fuid','$space');">下一篇</a>
						<a  class="fr" title="上一篇"href="{$basename}a=pre&fuid={$fuid}&did=$diary[did]" onclick="return ajaxpage(this.href,'pre','$fuid','$space');">上一篇</a>
					</div>
<!--
EOT;
require_once PrintEot('m_comment');print <<<EOT
-->
<script type="text/javascript" language="JavaScript" src="js/pw_lwd.js"></script>
		</div>
	</div>
<!--
EOT;
} elseif ($a == 'write' || $a == 'edit') {
print <<<EOT
-->
	<div class="p10 bdB cc">
<!--
EOT;
if ($a == 'write') {
$weibocheck = 'checked=checked';
$weibodisplay = '';
print <<<EOT
-->
            写新日志
<!--
EOT;
} else {
print <<<EOT
-->
            编辑日志
<!--
EOT;
}
$shortcut=$_GET['s']?'target=formTarget':'';
$formiframe=$shortcut?"<iframe width=0 height=0 name=formTarget src='javascript:;' onload=\"this.contentWindow.document.body.innerHTML.indexOf('操作完成')==-1?'':showDialog('success','日志发表成功！')&setEditorContent()&(read.menu.style.top='400px')&getObj('FORM').reset()\"></iframe>":"";
print <<<EOT
-->
            | <a href="{$basename}">返回我的日志</a>
	</div>
	<div class="p15">
			$formiframe
			<form action="{$basename}&a=$a" method="post" enctype="multipart/form-data" onsubmit="return checkpost(document.FORM);" name="FORM" id="FORM" $shortcut />
			<input type="hidden" name="did" value="$did" />
			<input type="hidden" name="dtided" value="$diary[dtid]" />
			<input type="hidden" name="privacyed" value="$diary[privacy]" />
			<input type="hidden" name="atc_autourl" value="1" />
			<input type="hidden" name="step" value="2" />
			<input type="hidden" name="verify" value="$verifyhash" />
			<div>
			<div class="mb10">
			<input type="text" class="input input_wb mr10" name="atc_title" id="atc_title" value="$diary[subject]"/><span id="atc_title_warn" class="gray">限 $db_titlemax 字节</span>
			<div id="menu_face" class="menu" style="display:none;"></div>
			</div>
			<div class="cc mb10 pr">
<!--
EOT;
require_once PrintEot('wysiwyg_editor');
print <<<EOT
-->			</div>
            <table cellpadding="0" cellspacing="0" width="100%" style=" table-layout:fixed;">
                <tr class="tr3">
                    <td width="62">日志分类</td>
                    <td><div class="dropdown mr10">
                        <select name="dtid" id="dtid_add"><option value="0" $dtid_0>默认分类</option>$dtsel</select></div><span class="btn_add"><span><button onclick="javascript:add_dtid('$uid','dtid_add');" type="button">添加分类</button></span></span>
                    </td>
                </tr>
                <tr class="tr3">
                    <td>隐私设置</td>
                    <td>
										<div class="dropdown mr10">
                        <select name="privacy" id="dtid_pvc" onchange="optionsel(this.value,'{$sendWeiboPrivacy}')">
                            <option value="0" $privacy_0>全站可见</option>
                            <option value="1" $privacy_1>仅好友可见</option>
                            <option value="2" $privacy_2>仅自己可见</option>
                        </select>
										</div>
						<label for="if_copy" class="mr10">
							<input id="if_copy" type="checkbox" name="ifcopy" value="1" $checked $disabled>&nbsp;允许转载
						</label>
<!--
EOT;
if ($sendWeiboPrivacy) {print <<<EOT
-->
						<label for="if_sendweibo" class="mr10" $weibodisplay id="lab_weibo">
							<input id="if_sendweibo" type="checkbox" name="ifsendweibo" value="1" $weibocheck >&nbsp;同时发送到新鲜事
						</label>
<!--
EOT;
}print <<<EOT
-->
						<!-- 将$convertChecked 替换成 checked="checked" -->
						<label for="atc_convert" style="display: none">
                       		 <input type="checkbox" name="atc_convert" id="atc_convert" value="1" checked="checked"/>&nbsp;Wind Code自动转换
                        </label>
                       
                    </td>
                </tr>
<!--
EOT;
if ($db_allowupload && $_G['allowupload'] || $attach) {print <<<EOT
-->
                <tr><td colspan="2">
                    <table cellPadding="0" cellSpacing="0" style="display:none" width="100%">
                    <tbody id="att_mode"><tr>
                        <td><input class="input" type="file" name="attachment_" size="20" /></td><td><input class="input" type="text" name="atc_desc" size="20" /></td>
                        <td><select style="display:none;"><option value="0"></option><option value="1">加密</option><option value="2">出售</option></select></td>
                        <td><select name="att_ctype" style="display:none;">{$alltype}</select></td>
                        <td><input class="input" type="hidden" name="atc_needrvrc" value="0" size="1" /></td>
                        <td></td></tr>
                    </tbody>
                    </table>
                </td>
            </tr>
<script language="JavaScript">
var allow_ext = '$uploadfiletype';
var allow_size = '$uploadfilesize';
var attachnum = parseInt('$db_attachnum');
var charset = '$db_charset';
var titlemax = '$db_titlemax';
var postmax = '$db_postmax';
initCheckTextNum('atc_title','atc_title_warn',titlemax);
initCheckTextNum('textarea','textarea_warn',postmax);
</script>
<script type="text/javascript" language="JavaScript" src="js/upload.js"></script>
<!--
EOT;
}if($attach){print <<<EOT
-->
<tr class="tr3">
    <td colspan="2" style="padding:0;border:0;">
        <div class="editor-mwidth">
            <table class="tr_p10" width="100%">
                <tr>
                    <td width="3%"></td>
                    <td width="240">该帖包含附件<span class="gray">(不想保留的附件去掉√)</span> :</td>
                    <td width="40">描述</td>
                    <td width="10%"></td>
                    <td width="10%"></td>
                    <td width="140"></td>
                    <td width="130"></td>
                </tr>
                <tbody id="ajaxtable"></tbody>
            </table>
<script language="JavaScript">
var attachs = {{$attach}};
oldAtt.init();
</script>
        </div>
    </td>
</tr>
<!--
EOT;
}
$shortcut=$_GET['s']?'':'tr3';

if($db_allowupload && $_G['allowupload']){print <<<EOT
-->
<tr class="$shortcut">
    <td style="padding-top:0;" colspan="2">
<!--
EOT;
$shortcut=$_GET['s']?' style="display:none"':'';
print <<<EOT
-->
        <table class="tr_p10" width="100%">
            <tr>
                <td style="padding-right:3em" width="35%">上传图片附件</td>
                <td>描述</td>
                <td width="10%"></td>
                <td width="10%"></td>
                <td width="8%"></td>
                <td width="100"></td>
            </tr>
            <tbody id="attach"></tbody>
        </table>
        <div id="viewimg" class="menu" style="display:none;"></div>
        <div id="attsize" $shortcut style="margin-top:10px">有效文件类型:$uploadfilesize</div>
    </td>
</tr>
<script language="JavaScript">
newAtt.create();
</script>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($o_diary_gdcheck) {print <<<EOT
-->
                <tr class="tr3 vt">
                    <td>认证码:</td>
                    <td>
                        <input class="input" onfocus="showCK();" type="text" name="gdcode" id="gdcode" size="5" tabindex="3"  />
<img id="ckcode" style=" vertical-align:top;cursor:pointer;display:none;margin-top:0px;border:1px solid #ccc;" onclick="this.src='ck.php?nowtime='+new Date().getTime();" alt="看不清楚，换一张" />
                    </td>
                </tr>
<!--
EOT;
}if($o_diary_qcheck){print <<<EOT
-->
                <tr class="tr3">
                    <td>验证问题:</td>
                    <td style="line-height:30px">
                    {$db_question[$qkey]} 
<!--
EOT;
if($showq){print <<<EOT
-->					
					（正确答案:{$db_answer[$qkey]}）
<!--
EOT;
}print <<<EOT
-->
                    <input class="input" name="qanswer" id="qanswer" size="25" tabindex="7" />
                    <input type="hidden" name="qkey" id="qkey" value="$qkey" />
                    </td>
                </tr>
<!--
EOT;
}print <<<EOT
-->
                <tr>
                    <td>&nbsp;</td>
                    <td>
                    <div class="p10">
                    	<span class="btn">
                    		<span><button name="Submit" type="submit">提 交</button></span>
                    	</span>
                    	<span class="bt">
                    		<span><button type="button" class="w_bt" onclick="savedraft();return false;">存为草稿</button></span>
                    	</span>
                    	</div>
                    </td>
                </tr>
            </table>
			</div>
			</form>
    </div>
<!--
EOT;
if($a == 'edit'){print <<<EOT
-->
<script language="JavaScript">setTimeout("editor.gotoEnd();",50);</script>
<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript">setTimeout("document.FORM.atc_title.focus()",50);</script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">var stylepath = 'wind';</script>
<!--
EOT;
if(R_P!=D_P){
$facedb = readover(D_P.'data/bbscache/face.js');
print <<<EOT
-->
<script language="javascript">
{$facedb}
</script>
<!--
EOT;
}else{print <<<EOT
-->
<script language="JavaScript" src="data/bbscache/face.js"></script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
editor.init('$editor', IsChecked('atc_html') ? 1 : 0);
var cnt  = 0;
document.FORM.Submit.disabled = false;
function checkpost(obj) {
	if (obj.atc_title.value == "") {
		showDialog("error","标题不能为空",2);
		obj.atc_title.focus();
		return false;
	} else if (strlen(obj.atc_title.value) > $db_titlemax) {
		showDialog("error","标题超过最大长度 $db_titlemax 个字节",2);
		obj.atc_title.focus();
		return false;
	}
	if (strlen(obj.atc_content.value) < $db_postmin) {
		showDialog("error","文章内容少于 $db_postmin 个字节",2);
		editor.focusEditor();
		return false;
	} else if (strlen(obj.atc_content.value) > $db_postmax) {
		showDialog("error","文章内容大于 $db_postmax 个字节",2);
		editor.focusEditor();
		return false;
	}
	//过滤检测上传图片
	var a = /\[url=(\d)\]/gmi.exec(obj.atc_content.value);
	for(var i=1;i<a.length;i++)
	{
		if(getObj('attachment_'+a[i]).value=='')
			obj.atc_content.value=obj.atc_content.value.replace(new RegExp('\\\\[url='+a[i]+'\]','gm'),'');
	}
	document.FORM.Submit.disabled = true;
	cnt++;
	if (cnt != 1) {
		showDialog("warning","Submission Processing. Please Wait");
		return false;
	}
	return true;
}
</script>
<script language="JavaScript" src="js/post.js"></script>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript" src="apps/diary/js/diarytype.js"></script>
<script language="JavaScript" src="js/app_comment.js"></script>
<script type="text/javascript" src="js/select.js"></script>
<script language="javascript">
var ifcheck = true;
function CheckAll(form,match) 
{
	for (var j = 0; j < form.length; j++) {
		for (var i = 0; i < form[j].elements.length; i++) {
			var e = form[j].elements[i];
			if (e.type == 'checkbox' && (typeof match == 'undefined' || e.name.match(match))) {
				e.checked = ifcheck;
			}
		}
	}
	ifcheck = ifcheck == true ? false : true;
}
</script>
<div class="c">&nbsp;</div>
</div>
<script type="text/javascript">
var ld=window.onload;
new sSelect(getObj('dtid_add'));
new sSelect(getObj('dtid_pvc'));
</script>
</div>
<!--
EOT;
require_once(uTemplate::printEot('footer'));
?>-->